#import "RebirthCharismaController.h"
        
#import "RebirthCharismaModel.h"
#import "RebirthCharismaCell.h"
#import "Masonry.h"

@interface RebirthCharismaController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *braveUmbrellaTableView;
@property (nonatomic, strong) NSMutableArray *fableZestfulFlourishDatas;

@end

@implementation RebirthCharismaController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self zealKindredXylophoneSetupview];
	[self gritJourneyfetchData];
}


- (void)zealKindredXylophoneSetupview {
    self.braveUmbrellaTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.braveUmbrellaTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.braveUmbrellaTableView.estimatedRowHeight = 0;
    self.braveUmbrellaTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.braveUmbrellaTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.braveUmbrellaTableView.delegate = self;
    self.braveUmbrellaTableView.dataSource = self;
    self.braveUmbrellaTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.braveUmbrellaTableView.showsVerticalScrollIndicator = NO;
    self.braveUmbrellaTableView.showsHorizontalScrollIndicator = NO;
    self.braveUmbrellaTableView.backgroundColor = UIColor.clearColor;
    [self.braveUmbrellaTableView registerClass:[RebirthCharismaCell class] forCellReuseIdentifier:NSStringFromClass([RebirthCharismaCell class])];
    [self.view addSubview:self.braveUmbrellaTableView];
    [self.braveUmbrellaTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)fableZestfulFlourishDatas {
	if (!_fableZestfulFlourishDatas) {
		_fableZestfulFlourishDatas = [NSMutableArray array];
	}
	return _fableZestfulFlourishDatas;
}

//: 获取数据模型
- (void)gritJourneyfetchData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.fableZestfulFlourishDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    RebirthCharismaCell *grit = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([RebirthCharismaCell class])];
    if (grit == nil) {
        grit = [[RebirthCharismaCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([RebirthCharismaCell class])];
    }
    grit.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return grit;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	RebirthCharismaModel *butterflyXenon = self.fableZestfulFlourishDatas[indexPath.row];
	return butterflyXenon.luminaryBreezeCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
